package day0401;


import java.util.Locale;
import java.util.Scanner;

public class SplitString1 {
    /**
     * 1.字符串分割
     * 输入
     * 3
     * 12abc-abCABc-4aB@
     * 输出:12abc-abc-ABC-4aB-@
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextLine()) {
            int k = Integer.parseInt(sc.nextLine());
            String[] strings = sc.nextLine().split("-");
            String s = "";
            for (int i = 1; i < strings.length; i++) {
                s += strings[i];
            }
            int index = 0;
            StringBuilder sb = new StringBuilder();
            sb.append(strings[0]);
            while (s.length() - index > k) {
                sb.append("-").append(caseTrans(s.substring(index, k + index)));
                index += k;
            }
            if (s.length() - index > 0) {
                sb.append("-").append(caseTrans(s.substring(index, s.length())));
            }
            System.out.println(sb);
        }

    }

    private static String caseTrans(String s) {
        int small = s.replaceAll("[A-Z]", "").length();
        int large = s.replaceAll("[a-z]", "").length();
        if (small > large) {
            return s.toLowerCase(Locale.ROOT);
        }
        if (small < large) {
            return s.toUpperCase(Locale.ROOT);
        }
        return s;
    }

}
